// pages/my/ruler.js
import CommonPage from "../../common/CommonPage.js"
const app = getApp()

class RulerPage extends CommonPage{

  /**
   * 页面的初始数据
   */
  constructor(...args) {
    super(...args)
    super.$init({
      text: "\n1. 叨币由两部分组成：活力值和算力值。\n" +
        "2. 活力值由用户线下活动生成，在这是运动步数，好友间可以相互赠送。\n" +
        "3. 每日运动步数0点清零。\n" +
        "4. 算力值由叨币道App内统计提供，用户需要注册登录叨币道App。\n",
      showImage: 'true',
      titleName: "规则说明",
      height: "0rpx",
      backImagePath: app.globalData.backImagePath
    })
  }
  initData = function(query, resolve, reject) {
    this.data.height = app.globalData.titleHeight
    this.$setData(this.data)
  }
  $onNavigator(query = {}) {
    console.debug("预加载-规则说明；参数：", query)
    this.$put("ruler-data", this.initData.bind(this), query)
  }
  back = function(params) {
    wx.navigateBack();
  }

  copy = function() {
    var that = this
    wx.setClipboardData({
      data: 'http://tonewme.com',
    })
  }

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad = function(options) {
    var dat = this.$take("ruler-data")
    if (dat) {
      return
    }
    this.initData()
  }
}

Page(new RulerPage({clazzName: "RulerPage"}))